import lwpgt

class Layer:
    def __init__(self, width, height):
        """init new layer"""
        self.layerdata=[]
        self.CreateBlankLayer(width, height)
        
    def SetTile(self, posx, posy, gameobj):
        """set tile on the layer in given position"""
        self.layerdata[posy][posx]=gameobj
        
    def GetTile(self, posx, posy):
        """get tile from layer at given position"""
        return self.layerdata[posy][posx]
    
    def CreateBlankLayer(self, width, height):
        """create clear map with (width,height) size"""
        row=[]
        self.layerdata=[]
        for h in range(height):
            for w in range(width):
                row.append(None)
            self.layerdata.append(row)
            row=[]
